extends Area2D


class_name IArea2DComponent
"""
带碰撞区域的组件
"""

## 是否可用(是否允许碰撞)
@export var is_enable: bool = true:
    set(v):
        __set_enable(v)
    get:
        return monitorable
## 是否冻结中(作为模板使用)
@export var is_frozen: bool = false: set = __set_frozen


# 是否已经初始化
var is_node_frozen: bool = false

func __set_enable(value: bool) -> void:
    monitoring = value
    monitorable = value
    IComponent.set_enable_process(self, monitorable)

func __set_frozen(value: bool) -> void:
    # true -> false
    if is_frozen and not value:
        is_frozen = false
        __prepare()
    else:
        is_frozen = value

func __check_exports() -> Dictionary:
    return {}

func __init_hooks() -> Dictionary:
    return {}

func __prepare() -> void:
    IComponent.prepare(self)

func __reset() -> void:
    IComponent.reset(self)

func _get_configuration_warnings():
    return IComponent.editor_warnings(self)

func _ready():
    IComponent.ready(self)
